from alg import MagicDictionary

test_cases = [
    {
        "dictionary": ["hello", "leetcode"],
        "search_words": ["hello", "hhllo", "hell", "leetcoded"],
        "expected": [False, True, False, False],
    },
    # 这里可以添加更多测试用例
]

for i, test_case in enumerate(test_cases):
    print(f"测试用例 {i+1}:")
    magic_dict = MagicDictionary()
    magic_dict.buildDict(test_case["dictionary"])
    for word, expected in zip(test_case["search_words"], test_case["expected"]):
        result = magic_dict.search(word)
        print(
            f"搜索 '{word}': 预期 {expected}, 实际 {result}",
            "✓" if result == expected else "✗",
        )
    print()
